import React, { memo } from 'react'
import "./index.less"

const Index = ({ detaiObj, infoFields }) => {
    return (
        <div className="info">
            <div className="d-title">{infoFields.title.name}:{detaiObj[infoFields.title.field]}</div>
            <div className="info-main">
                {
                    infoFields.column.map(el => {
                        return (
                            <div className="m-line" key={el.no}>
                                <div className="m-name">{el.name}：</div>
                                <div className="m-val">
                                    {
                                        el.field == 'status' ? el['statusList'] && el['statusList'].find(es => es.value == detaiObj['status'])?.label
                                            : detaiObj[el.field]
                                    }
                                </div>
                            </div>
                        )
                    })
                }
            </div>
        </div>
    )
}

export default memo(Index)
